<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // function Person(name) {
      //   console.log('hello ' + name);
      // }
      // 类 class
      class Person {
        constructor(name) {
          // new 自动调用
          console.log('hello ' + name);
        }
      }
      console.log(typeof Person);
      const p = new Person('jack');
    </script>
  </body>
</html>
